package ControlLayer;
import ModelLayer.*;
import java.util.ArrayList;

/**
 * Controller class for the DVD collection
 * 
 * @author (kbh) 
 * @version (2005.03.31)
 * @revised version English (Ab)
 * (FEN): 2006.03.21: Some changes to the architecture in order to assure layering
 *                    and loose coupling
 */
public class DVDCtr
{
    private DVDCollection dvdCollection;

    /**
     * Constructor for objects of class DVDCtr
     */
    public DVDCtr()
    {
     dvdCollection = DVDCollection.getInstance();
    }
    

    public DVD getDVD(long id)
    {
        DVD d = dvdCollection.getDVD(id);
   
       return d; 
    }
    
    public void createDVD(long id, String title, String director, int releaseDate)
    {       
          DVD d = new DVD(id, title, director, releaseDate);
          dvdCollection.addDVD(d);
    }
    
    public void updateDVD(long id, String title, String director, int releaseDate)
    {
        dvdCollection.updateDVD(id, title, director, releaseDate);
    }
    
    public void deleteDVD(long id)
    {
        dvdCollection.deleteDVD(id);
    }
    
    public void createCopy(int serialNo, int accDate, int accPrice, DVD d)
    {
        Copy c = new Copy(serialNo, accDate, accPrice, d);
        d.addCopy(c);
    }
    public void updateCopy(int serialNo, int accDate, int accPrice, DVD d)
    {
        d.updateCopy(serialNo, accDate, accPrice);
    }
    
    public ArrayList listAllDvds()
    {
          //returns a list of all dvds and their associated copies
          return null;
    }
}
